#ifndef DECODER_HPP
#define DECODER_HPP

#include <QObject>
#include <QMap>
#include <QStringList>
#include <QDebug>
#include <QList>

#include "command.hpp"

/**
* @brief
*
* @class Decoder decoder.hpp "decoder.hpp"
*/
class Decoder : public QObject
{
Q_OBJECT
public:
    /**
    * @brief Default Constructor
    *
    * @fn Decoder
    * @param parent
    */
    explicit Decoder(QObject *parent = 0);

    /**
    * @brief Destructor
    *
    * @fn ~Decoder
    */
    ~Decoder();

    /**
    * @brief Decode a given String into a Command Object
    *
    * @fn decodeLstString
    * @param line
    * @return Command
    */
    Command *decodeLstString(QString line);

    /**
    * @brief Reset all saved entries and prepare for a new program
    *
    * @fn reset
    */
    void reset();

    QMap<QString, int> *getLabelMap();

private:
    QMap<QString, int> equMap;
    QMap<QString, int> labelMap;
    QList<QString> pendingLabels;

signals:
    void customHighlightingRule(QString pattern, int type);
    void customTooltip(QString var, QString tooltip);
    void variableFound(QString name, QString address);

};

#endif // DECODER_HPP
